<?php
namespace app\admin\model;

use think\Model;
use think\Request;

class Signup extends Model
{


    public function position()
    {
        return $this->belongsTo(Position::class,'position_id','id');
    }

    public static  function getActionJob(Request $request,$hunter_id)
    {
        $genData = $request->get();
        $genData = getOutpageData($genData);

        if (count($genData)>=2||isset($genData['searchval'])) {
            $fileds = ['mobile', 'realname'];
            $whereData = genWhereOrData($genData,$fileds);
            $model= makeWhereObject((new self()), $whereData);
        } else {
            $model=  (new self())->where($genData);
        }

        $res = $model->order('id','desc')->with('position')->where('hunter_id', $hunter_id)
            ->paginate(10, false,[  'var_page' => 'page']);
        return $res;
    }
}